<template>
    <div class="tools">
        <div class="main">
            <div class="menu">
                <el-menu
                    :default-active="pathType"
                    class="el-menu-vertical-demo"
                    @select="handleSelect"
                >
                    <el-menu-item index="taxcount">
                        <span slot="title">增值税计算器</span>
                    </el-menu-item>
                    <el-menu-item index="deditcount">
                        <span slot="title">违约金计算器</span>
                    </el-menu-item>
                    <el-menu-item index="penalsum">
                        <span slot="title">利息计算</span>
                    </el-menu-item>
                    <el-menu-item index="homecount">
                        <span slot="title">房贷计算器</span>
                    </el-menu-item>
                    <el-menu-item index="securitycount">
                        <span slot="title">社保计算</span>
                    </el-menu-item>
                    <el-menu-item index="taxdate">
                        <span slot="title">办税日历</span>
                    </el-menu-item>
                    <el-menu-item index="personaltax">
                        <span slot="title">个税计算器</span>
                    </el-menu-item>
                    <el-menu-item index="taxsearch">
                        <span slot="title">税率查询</span>
                    </el-menu-item>
                    <el-menu-item index="invoiceassistant">
                        <span slot="title">发票助手</span>
                    </el-menu-item>
                </el-menu>
            </div>
            <div class="content">
                <div v-if="show" :is="pathType"></div>
            </div>
        </div>
    </div>
</template>

<script>
import taxcount from "@/components/Tools/taxCount";
import deditcount from "@/components/Tools/deditCount";
import penalsum from "@/components/Tools/penalSum";
import homecount from "@/components/Tools/homeCount";
import securitycount from "@/components/Tools/securityCount";
import personaltax from "@/components/Tools/personalTax";
import taxsearch from "@/components/Tools/taxSearch";
import taxdate from "@/components/Tools/taxDate";
import invoiceassistant from "@/components/Tools/invoiceAssistant";
import { getanalysedata2 } from "@/assets/api/indexApi.js";
export default {
    components: {
        taxcount,
        deditcount,
        penalsum,
        homecount,
        securitycount,
        personaltax,
        taxsearch,
        taxdate,
        invoiceassistant,
    },
    layout: "home",
    head() {
        return {
            title: "财税工具-【小竹财税平台】",
            meta: [
                {
                    hid: "keywords",
                    name: "keywords",
                    content: "小竹财税,财税工具",
                },
            ],
        };
    },
    data() {
        return {
            pathType: "",
            show: true,
        };
    },
    watch: {},
    created() {},
    mounted() {
        if (this.$route.params.type) this.pathType = this.$route.params.type;
        let addp = { m_id: 14, type: 1, describe: "增值税计算器", code: "PW5" };
        switch (this.pathType) {
            case "taxcount":
                addp.describe = "增值税计算器";
                addp.code = "PW5";
                break;
            case "deditcount":
                addp.describe = "违约金计算器";
                addp.code = "PW6";
                break;
            case "penalsum":
                addp.describe = "利息计算";
                addp.code = "PW7";
                break;
            case "homecount":
                addp.describe = "房贷计算器";
                addp.code = "PW8";
                break;
            case "securitycount":
                addp.describe = "社保计算";
                addp.code = "PW9";
                break;
            case "taxdate":
                addp.describe = "办税日历";
                addp.code = "PW10";
                break;
            case "personaltax":
                addp.describe = "个税计算器";
                addp.code = "PW11";
                break;
            case "taxsearch":
                addp.describe = "税率查询";
                addp.code = "PW12";
                break;
            case "invoiceassistant":
                addp.describe = "发票助手";
                addp.code = "PW4";
                break;
        }
        getanalysedata2(addp);
    },
    computed: {},
    watch: {},
    methods: {
        handleSelect(key) {
            this.$router.push({
                path: "/tools/" + key,
            });
            this.pathType = key;
            this.show = false;
            this.$nextTick(() => {
                this.show = true;
            });
        },
    },
};
</script>

<style lang="scss" scoped>
.tools {
}

.main {
    width: 1200px;
    margin: 30px auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    // min-height: 513px;
    .content {
        background-color: #fff;
        min-height: 564px;
    }
    .menu {
        background-color: #fff;
        padding: 10px 0 50px;
        width: 127px;
    }
    .content {
        background-color: #fff;
        width: 1055px;
    }
}
</style>